]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Revert "app-cache: Fix cache for folder translations"
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 13 Apr 2020 13:41:54 +0000 (15:41 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 13 Apr 2020 14:56:34 +0000 (14:56 +0000)
Existing folders as created by gnome-software (including the
default ones) all have the .directory suffix, so dropping
the suffix from the keys broke those folders.

This reverts commit 343b3351f172e112e1a70b54956ab3444140fbf4.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2623

src/shell-app-cache.c

index 9b33c7ac2cb66c60820b674eb22602275566097b..15d4734d0fea43eba1a2c362b2c86bc9ed9a1703 100644 (file)
@@ -109,17 +109,11 @@ load_folder (GHashTable *folders,
 
   while ((name = g_dir_read_name (dir)))
     {
-      g_autofree gchar *stripped_name = NULL;
       g_autofree gchar *filename = NULL;
       g_autoptr(GKeyFile) keyfile = NULL;
 
-      if (!g_str_has_suffix (name, ".directory"))
-        continue;
-
-      stripped_name = g_strndup (name, strlen (name) - strlen (".directory"));
-
       /* First added wins */
-      if (g_hash_table_contains (folders, stripped_name))
+      if (g_hash_table_contains (folders, name))
         continue;
 
       filename = g_build_filename (path, name, NULL);
@@ -134,8 +128,7 @@ load_folder (GHashTable *folders,
                                                      NULL, NULL);
 
           if (translated != NULL)
-            g_hash_table_insert (folders, g_steal_pointer (&stripped_name),
-                                 translated);
+            g_hash_table_insert (folders, g_strdup (name), translated);
         }
     }
 }